import axios from 'axios';
let baseUrl = process.env.API_URL;
export const GET=(url,params)=>{
    axios.defaults.headers.common['authorization'] = 'Bearer '+localStorage.getItem('token')
    return axios.get(`${baseUrl}${url}`,{params:params}).then((data)=>{return data})
}
export const POST = (url,params)=>{
    axios.defaults.headers.common['authorization'] = 'Bearer '+localStorage.getItem('token')
    return axios.post(`${baseUrl}${url}`,params).then((data)=>{return data})
}
export const PUT = (url,params)=>{
    axios.defaults.headers.common['authorization'] = 'Bearer '+localStorage.getItem('token')
    return axios.put(`${baseUrl}${url}`,params).then((data)=>{return data})
}
export const DELETE = (url,params)=>{
    axios.defaults.headers.common['authorization'] = 'Bearer '+localStorage.getItem('token')
    return axios.delete(`${baseUrl}${url}`,{params:params}).then((data)=>{return data})
}